from python import Python
from tensor import Tensor
from math import sqrt
from time import now

alias N = 10000000

fn main() raises:
    let np = Python.import_module("numpy")

    let A = np.random.rand(N)
    let B = np.random.rand(N)

    let n: Int = N 
    var a = Tensor[DType.float64](n)
    var b = Tensor[DType.float64](n)

    for i in range(n):
        a[i] = A[i].to_float64()
        b[i] = B[i].to_float64()

    let start: Float64 = now()
    let result: Float64 = dist(a, b)
    let end: Float64 = now()
    print(result, (end - start) / 1e6)

    
fn dist(a: Tensor[DType.float64], b: Tensor[DType.float64]) -> Float64:
    var d: Float64 = 0.0
    let n: Int = a.num_elements()g
        d += delta ** 2
    return sqrt(d)

